<?php

namespace Kunfeng\Dify\Model\Datasets;

/**
 * 语义检索响应模型
 */
class RetrieveResponse
{
    private $query;
    private $records;

    public function __construct(array $data)
    {
        $this->query = $data['query'] ?? '';
        $this->records = $data['records'] ?? [];
    }

    /**
     * 从数组创建
     */
    public static function fromArray(array $data): self
    {
        return new self($data);
    }

    // Getters
    public function getQuery(): string
    {
        return $this->query;
    }

    public function getRecords(): array
    {
        return $this->records;
    }
}
